import request from '@/utils/request'
import dateUtils from '@/utils/date'

function getSourceStateAllNum() {
  return request({
    url: '/api/hotstandbylogsource/getStateAllNum',
    method: 'get'
  })
}
function getTableStateAllNum() {
  return request({
    url: '/api/hotstandbylogtable/getStateAllNum',
    method: 'get'
  })
}

function getHotBackupLibraryTotal() {
  const date = new Date()
  const params = {
    staTime: dateUtils.getDateYMFormatStr(date),
    endTime: dateUtils.getDateYMFormatStr(date)
  }
  return request({
    url: '/api/synccompletelibrarytask/hotBackupLibraryTotal',
    method: 'get',
    params
  })
}
function getHotBackupLibraryTableTotal() {
  const date = new Date()
  const params = {
    staTime: dateUtils.getDateYMFormatStr(date),
    endTime: dateUtils.getDateYMFormatStr(date)
  }
  return request({
    url: '/api/synccompletelibrarytask/hotBackupLibraryTableTotal',
    method: 'get',
    params
  })
}

export default { getSourceStateAllNum, getTableStateAllNum, getHotBackupLibraryTotal, getHotBackupLibraryTableTotal }
